/*
Rilego - An easy Images 2 E-Book converter.
Copyright (C) 2011  Federico Improta (Kirys)

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 */
package it.kirys.rilego.engine.outputbuilders;

import java.awt.image.ColorModel;
import java.awt.image.IndexColorModel;

/**
 *
 * @author Federico Improta
 */
public class ImageSize {

	public static final byte[] GRAY_8_SHADES = {
		(byte) 0xff, (byte) 0xd8, (byte) 0xb4, (byte) 0x90,
		(byte) 0x6c, (byte) 0x48, (byte) 0x24, (byte) 0x00
	};
	public static final byte[] GRAY_16_SHADES = {
		(byte) 0xf0, (byte) 0xe0, (byte) 0xd0, (byte) 0xc0,
		(byte) 0xb0, (byte) 0xa0, (byte) 0x90, (byte) 0x80,
		(byte) 0x70, (byte) 0x60, (byte) 0x50, (byte) 0x40,
		(byte) 0x30, (byte) 0x20, (byte) 0x10, (byte) 0x00
	};
	public static final IndexColorModel GRAY_8_SHADES_MODEL = new IndexColorModel(4, 8, GRAY_8_SHADES, GRAY_8_SHADES, GRAY_8_SHADES);
	public static final IndexColorModel GRAY_16_SHADES_MODEL = new IndexColorModel(5,16, GRAY_16_SHADES, GRAY_16_SHADES, GRAY_16_SHADES);

	int width;
	int height;
	ColorPalette palette;

	public ColorPalette getDestinationPalette() {
		return palette;
	}

	public boolean hasDestinationPalette() {
		return palette != null;
	}

	public int getHeight() {
		return height;
	}

	public int getWidth() {
		return width;
	}

	public ImageSize(int width, int height) {
		this.width = width;
		this.height = height;
		this.palette = null;
	}

	public ImageSize(int width, int height, ColorPalette preferredPalette) {
		this(width, height);
		this.palette = preferredPalette;
	}
}
